package cn.kgc.vue.ScheduledTasks;

import cn.kgc.vue.mapper.LogInfoMapper;
import cn.kgc.vue.service.LogInfoService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 张航
 * @Date 2024/7/11
 * @Description
 */
@Component
public class LogScheduled {

    @Resource
    private LogInfoMapper logInfoMapper;

    //每个月最后一天晚上11点执行
    @Scheduled(cron ="0 0 23 L * ?")
    //每隔一分钟执行
   // @Scheduled(cron = "0 0/1 * * * ?")
    public void deleteLogs() {
        List<Integer> integers = logInfoMapper.selectLogsTasks();
        logInfoMapper.deleteBatchIds(integers);
    }

}
